/**
  ******************************************************************************
  * @file           : paraupcb.c
  * @brief          : 参数更新回调函数
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "bsp.h"
#include "parameter.h"
#include "measure.h"

#define v(x)             (para_##x)
#define p(x)             (PARA_##x##_IDX)
#define m(x)             (GVHR_##x##_ADDR)
#define mh(x)            (GVHR_##x##_H_ADDR)
#define ml(x)            (GVHR_##x##_L_ADDR)
#define stgup16(x, y)     do{mb_mmrw.holdreg[m(y)]=v(x);}while(0)
#define stgup32(x, y)     do{mb_mmrw.holdreg[ml(y)]=(uint16_t)v(x);mb_mmrw.holdreg[mh(y)]=(uint16_t)(v(x)>>16);}while(0)

const char sys_rtc_print_format_A[32] = "%04u-%02u-%02u %02u:%02u Auto  ";
const char sys_rtc_print_format_M[32] = "%04u-%02u-%02u %02u:%02u Manual";


void sto_upcb_fpointer(main_display_pos1)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.main_display_pos1 = dat.ut16;
}

void sto_upcb_fpointer(main_display_pos2)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.main_display_pos2 = dat.ut16;
}

extern uint32_t gui_mainmenu_refresh_time;
void sto_upcb_fpointer(refresh_rate)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.refresh_rate = dat.ut16;
  gui_mainmenu_refresh_time = 1000/gv.hr.meas_pa.refresh_rate;
}

void sto_upcb_fpointer(num_of_class)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.num_of_class = dat.ut16;
}


void sto_upcb_fpointer(local_number)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.local_number = dat.ut32;
}

void sto_upcb_fpointer(measuring_range_tph)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.measuring_range_tph = dat.ut32;
//  gv.whr.pa.measuring_range_tph = dat.ut32;
}

void sto_upcb_fpointer(division_kg)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.division_kg = dat.ut16; /* 累计分度值 MBHR_DIVISIONENUM */
//  gv.whr.pa.division_kg = dat.ut16;
}

void sto_upcb_fpointer(auto_zero_range)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.auto_zero_range = dat.ut16; /* 自动调零强度 */
//  gv.whr.pa.auto_zero_range = dat.ut16;
}

void sto_upcb_fpointer(manu_zero_range)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.manu_zero_range = dat.ut16; /* 手动调零强度 */
//  gv.whr.pa.manu_zero_range = dat.ut16;
}

void sto_upcb_fpointer(speed_low_limit)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.speed_low_limit = dat.ut16; /* 实测速度内码下限 */
//  gv.whr.pa.speed_low_limit = dat.ut16;
}

void sto_upcb_fpointer(flowrate_lowlim_kgh)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.flowrate_lowlim_kgh = dat.st16; /* 有效流量下限 */
//  gv.whr.pa.flowrate_lowlim_kgh = dat.st16;
}

void sto_upcb_fpointer(weight_pulse_wide)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_pulse_wide = dat.ut16; /* 定量脉冲开关及宽度 */
//  gv.whr.pa.weight_pulse_wide = dat.ut16;
}

void sto_upcb_fpointer(weight_pulse_set_kg)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_pulse_set_kg = dat.ut32; /* 定量脉冲累计目标值 */
//  gv.whr.pa.weight_pulse_set_kg = dat.ut32;
}

void sto_upcb_fpointer(len_circle_mode)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  /* 整圈方式 */
  if(dat.ut16 == MEAS_LEN_CIRCLE_FIXTIME)
  {
    gv.hr.meas_pa.len_circle_mode = MEAS_LEN_CIRCLE_FIXTIME;
  //  gv.whr.pa.len_circle_mode = MEAS_LEN_CIRCLE_FIXTIME;
  }
  else
  {
    gv.hr.meas_pa.len_circle_mode = MEAS_LEN_CIRCLE_FIXLENG;
  //  gv.whr.pa.len_circle_mode = MEAS_LEN_CIRCLE_FIXLENG;
  }
}

void sto_upcb_fpointer(belt_period_0d01s)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.belt_period_0d01s = dat.ut32; /* 皮带周期 */
//  gv.whr.pa.belt_period_0d01s = dat.ut32;
}

void sto_upcb_fpointer(belt_length_mm)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.belt_length_mm = dat.ut32; /* 皮带周长 */
//  gv.whr.pa.belt_length_mm = dat.ut32;
}

void sto_upcb_fpointer(effect_length_mm)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.effect_length_mm = dat.ut32; /* 称量长度 */
//  gv.whr.pa.effect_length_mm = dat.ut32;
}

void sto_upcb_fpointer(speed_wheel_cir_0d1mm)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.speed_wheel_cir_0d1mm = dat.ut16; /* 测速轮周长 */
//  gv.whr.pa.speed_wheel_cir_0d1mm = dat.ut16;
}

void sto_upcb_fpointer(speed_wheel_pls)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.speed_wheel_pls = dat.ut16; /* 测速轮每周脉冲 */
//  gv.whr.pa.speed_wheel_pls = dat.ut16;
}

void sto_upcb_fpointer(ao1_zero_code)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.ao1_zero_code = dat.ut16; /* AO1零点内码(PWM值) */
//  gv.whr.pa.ao1_zero_code = dat.ut16;
}

void sto_upcb_fpointer(ao1_full_code)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.ao1_full_code = dat.ut16; /* AO1满度内码(PWM值) */
//  gv.whr.pa.ao1_full_code = dat.ut16;
}

void sto_upcb_fpointer(ao2_zero_code)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.ao2_zero_code = dat.ut16; /* AO2零点内码(PWM值) */
//  gv.whr.pa.ao2_zero_code = dat.ut16;
}

void sto_upcb_fpointer(ao2_full_code)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.ao2_full_code = dat.ut16; /* AO2满度内码(PWM值) */
//  gv.whr.pa.ao2_full_code = dat.ut16;
}

void sto_upcb_fpointer(zero_code_uplimit)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.zero_code_uplimit = dat.st32; /* 零点内码上限 */
//  gv.whr.pa.zero_code_uplimit = dat.st32;
}

void sto_upcb_fpointer(zero_code_ave)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.zero_code_ave = dat.st32; /* 零点总平均内码 */
//  gv.whr.pa.zero_code_ave = dat.st32;
}

/* 零点内码离散 */

void sto_upcb_fpointer(factor_correct_enable)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.factor_correct_enable = dat.ut16; /* 系数修正使能 */
//  gv.whr.pa.factor_correct_enable = dat.ut16;
}

void sto_upcb_fpointer(weight_factor_base)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_factor_base = dat.ut32; /* 称量系数基础值 */
//  gv.whr.pa.weight_factor_base = dat.ut32;
}

void sto_upcb_fpointer(weight_factor01)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_factor01 = dat.ut32; /* 称量系数修正01 (  >1600   t/h) */
//  gv.whr.pa.weight_factor01 = dat.ut32;
}

void sto_upcb_fpointer(weight_factor02)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_factor02 = dat.ut32; /* 称量系数修正02 (1200~1600 t/h) */
//  gv.whr.pa.weight_factor02 = dat.ut32;
}

void sto_upcb_fpointer(weight_factor03)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_factor03 = dat.ut32; /* 称量系数修正03 (800~1200  t/h) */
//  gv.whr.pa.weight_factor03 = dat.ut32;
}

void sto_upcb_fpointer(weight_factor04)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_factor04 = dat.ut32; /* 称量系数修正04 (400~800   t/h) */
//  gv.whr.pa.weight_factor04 = dat.ut32;
}

void sto_upcb_fpointer(weight_factor05)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.weight_factor05 = dat.ut32; /* 称量系数修正05 (  <400    t/h) */
//  gv.whr.pa.weight_factor05 = dat.ut32;
}

void sto_upcb_fpointer(cal_fama_weight_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.cal_fama_weight_0d1g = dat.ut32; /* 校验砝码重量 */
//  gv.whr.pa.cal_fama_weight_0d1g = dat.ut32;
}

void sto_upcb_fpointer(cal_shiwu_weight_kg)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.cal_shiwu_weight_kg = dat.ut32; /* 校验实物重量 */
//  gv.whr.pa.cal_shiwu_weight_kg = dat.ut32;
}

void sto_upcb_fpointer(cal_shiwu_wtacc)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.cal_shiwu_wtacc = dat.ut32; /* 校验实物重量是否计入产量 */
//  gv.whr.pa.cal_shiwu_wtacc = dat.ut32;
}

void sto_upcb_fpointer(cal_lianma_denser_0d1gpm)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.cal_lianma_denser_0d1gpm = dat.ut32; /* 校验链码密度 */
//  gv.whr.pa.cal_lianma_denser_0d1gpm = dat.ut32;
}

void sto_upcb_fpointer(wad_preset_value)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.wad_preset_value = dat.st32; /* 重量内码内给值 */
//  gv.whr.pa.wad_preset_value = dat.st32;
}

void sto_upcb_fpointer(wad_preset_enable)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.wad_preset_enable = dat.ut16; /* 重量内码内给开关 */
//  gv.whr.pa.wad_preset_enable = dat.ut16;
}

void sto_upcb_fpointer(sad_preset_value)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.sad_preset_value = dat.ut16; /* 速度内码内给值 */
//  gv.whr.pa.sad_preset_value = dat.ut16;
}

void sto_upcb_fpointer(sad_preset_enable)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.sad_preset_enable = dat.ut16; /* 速度内码内给开关 */
//  gv.whr.pa.sad_preset_enable = dat.ut16;
}

void sto_upcb_fpointer(spd_sensor_addr)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.spd_sensor_addr = dat.ut16; /* 传感器 速度  地址 */
}

void sto_upcb_fpointer(wt1_sensor_addr)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.wt1_sensor_addr = dat.ut16; /* 传感器 称重1 地址 */
}

void sto_upcb_fpointer(wt2_sensor_addr)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.wt2_sensor_addr = dat.ut16; /* 传感器 称重2 地址 */
}

void sto_upcb_fpointer(wt3_sensor_addr)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.wt3_sensor_addr = dat.ut16; /* 传感器 称重3 地址 */
}

void sto_upcb_fpointer(wt4_sensor_addr)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.wt4_sensor_addr = dat.ut16; /* 传感器 称重4 地址 */
}

void sto_upcb_fpointer(year_begin_zero)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.year_begin_zero = dat.ut16;
//  gv.whr.pa.year_begin_zero = dat.ut16;
}

void sto_upcb_fpointer(month_begin_zero)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.month_begin_zero = dat.ut16;
//  gv.whr.pa.month_begin_zero = dat.ut16;
}

void sto_upcb_fpointer(day_begin_zero)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.day_begin_zero = dat.ut16;
//  gv.whr.pa.day_begin_zero = dat.ut16;
}

void sto_upcb_fpointer(acc_class01_start_time)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.acc_class01_start_time = dat.ut32;
}

void sto_upcb_fpointer(acc_class02_start_time)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.acc_class02_start_time = dat.ut32;
}

void sto_upcb_fpointer(acc_class03_start_time)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.acc_class03_start_time = dat.ut32;
}

void sto_upcb_fpointer(acc_class04_start_time)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.acc_class04_start_time = dat.ut32;
}

void sto_upcb_fpointer(total_last_switch)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.wtacc_total_last_switch = dat.dt;
}

void sto_upcb_fpointer(year_last_switch)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.wtacc_year_last_switch = dat.dt;
}

void sto_upcb_fpointer(month_last_switch)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.wtacc_month_last_switch = dat.dt;
}

void sto_upcb_fpointer(day_last_switch)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.wtacc_day_last_switch = dat.dt;
}

void sto_upcb_fpointer(hour_last_switch)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.wtacc_hour_last_switch = dat.dt;
}

void sto_upcb_fpointer(class_last_switch)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.wtacc_class_last_switch = dat.dt;
}

void sto_upcb_fpointer(total_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.total_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(year_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.year_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(month_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.month_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(day_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.day_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(hour_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.hour_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(pulse_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.pulse_acc_0d1g = dat.st64;
  gv.ir.meas_ca.pulse_acc_kg = gv.ir.meas_ca.pulse_acc_0d1g / 10000;
}

void sto_upcb_fpointer(class01_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class01_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(class02_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class02_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(class03_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class03_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(class04_acc_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class04_acc_0d1g = dat.st64;
}

void sto_upcb_fpointer(total_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.total_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.total_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(year_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.year_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.year_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(month_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.month_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.month_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(day_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.day_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.day_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(hour_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.day_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.day_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(class01_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class01_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.class01_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(class02_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class02_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.class02_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(class03_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class03_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.class03_acc_last_kg = dat.st64 / 10000;
}

void sto_upcb_fpointer(class04_acc_last_0d1g)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.ir.meas_ca.class04_acc_last_0d1g = dat.st64;
  gv.ir.meas_ca.class04_acc_last_kg = dat.st64 / 10000;
}

/* 市名/编号 */
void sto_upcb_fpointer(prod_city_num)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_city_num = dat.ut32;
}
/* 县名/编号 */
void sto_upcb_fpointer(prod_county_num)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_county_num = dat.ut32;
}
/* 矿名/编号 */
void sto_upcb_fpointer(prod_mines_num)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_mines_num = dat.ut32;
}
/* 核定年生产能力 */
void sto_upcb_fpointer(prod_year_capacity_t)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_year_capacity_t  = dat.ut32;
  gv.hr.meas_pa.prod_day_capacity_t   = gv.hr.meas_pa.prod_year_capacity_t/330;
  gv.hr.meas_pa.prod_month_capacity_t = gv.hr.meas_pa.prod_day_capacity_t*30;
  gv.hr.meas_pa.prod_hour_capacity_t  = gv.hr.meas_pa.prod_day_capacity_t/16;
}
/* 核定月生产能力 */
void sto_upcb_fpointer(prod_month_capacity_t)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_month_capacity_t = dat.ut32;
}
/* 核定日生产能力 */
void sto_upcb_fpointer(prod_day_capacity_t)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_day_capacity_t = dat.ut32;
}
/* 核定时生产能力 */
void sto_upcb_fpointer(prod_hour_capacity_t)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_hour_capacity_t = dat.ut32;
}
/* 间隔参量时间 也是上传时间 s */
void sto_upcb_fpointer(prod_interval_time_s)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_interval_time_s = dat.ut32;
}
/* 产量网络发送超时时间 s */
void sto_upcb_fpointer(prod_net_timeout_s)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.prod_net_timeout_s = dat.ut32;
}
/* 本机IP  u8x4 */
void sto_upcb_fpointer(eth_local_ip)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_local_ip[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_local_ip[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_local_ip[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_local_ip[3] = dat.ua8[3];
}
/* 网关    u8x4 */
void sto_upcb_fpointer(eth_local_gw)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_local_gw[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_local_gw[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_local_gw[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_local_gw[3] = dat.ua8[3];
}
/* 子网掩码 u8x4 */
void sto_upcb_fpointer(eth_local_msk)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_local_msk[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_local_msk[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_local_msk[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_local_msk[3] = dat.ua8[3];
}
/* 本机MAC u8x6 */
void sto_upcb_fpointer(eth_local_mac)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_local_mac[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_local_mac[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_local_mac[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_local_mac[3] = dat.ua8[3];
  gv.hr.meas_pa.eth_local_mac[4] = dat.ua8[4];
  gv.hr.meas_pa.eth_local_mac[5] = dat.ua8[5];
}
/* 间隔参量上传 目标服务器ip u8x4 */
void sto_upcb_fpointer(eth_produp_ip)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_produp_ip[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_produp_ip[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_produp_ip[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_produp_ip[3] = dat.ua8[3];
}
/* 实时参量上传 目标服务器ip u8x4 */
void sto_upcb_fpointer(eth_prodrt_ip)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_prodrt_ip[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_prodrt_ip[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_prodrt_ip[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_prodrt_ip[3] = dat.ua8[3];
}
/* modbusTCP  目标服务器ip u8x4 */
void sto_upcb_fpointer(eth_mbtcp_ip)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_mbtcp_ip[0] = dat.ua8[0];
  gv.hr.meas_pa.eth_mbtcp_ip[1] = dat.ua8[1];
  gv.hr.meas_pa.eth_mbtcp_ip[2] = dat.ua8[2];
  gv.hr.meas_pa.eth_mbtcp_ip[3] = dat.ua8[3];
}
/* 间隔参量上传 目标服务器端口 */
void sto_upcb_fpointer(eth_produp_port)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_produp_port= dat.ut16;
}
/* 实时参量上传 目标服务器端口 */
void sto_upcb_fpointer(eth_prodrt_port)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_prodrt_port= dat.ut16;
}
/* modbusTCP  目标服务器端口 */
void sto_upcb_fpointer(eth_mbtcp_prot)(uint16_t idx, Sto_CellUnion dat, void *dest)
{
  gv.hr.meas_pa.eth_mbtcp_prot= dat.ut16;
}
